
{% extends 'layouts/master.html' %}

{% set page = 'files' %}

{% block title %}Gitamin{% endblock %}

{% block breadcrumb %}
    {% include 'partials/breadcrumb.html' with {breadcrumbs: breadcrumbs} %}
{% endblock %}

{% block content %}

    <div class="source-view">
        <div class="source-header">
            <div class="meta"></div>

            <div class="btn-group pull-right">
                <a href="{{ route('blob_raw', {owner: owner.slug, project: project.slug, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-default btn-sm"><span class="octicon octicon-file-text"></span> Raw</a>
                <a href="{{ route('blame', {owner: owner.slug, project: project.slug, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-default btn-sm"><span class="octicon octicon-unmute"></span> Blame</a>
                <a href="{{ route('commits', {owner: owner.slug, project: project.slug, commitishPath: branch ~ '/' ~ file}) }}" class="btn btn-default btn-sm"><span class="octicon octicon-history"></span> History</a>
            </div>
        </div>
        {% if file_type == 'image' %}
        <div class="text-center"><img src="{{ route('blob_raw', {owner: owner.slug, project: project.slug, commitishPath: branch ~ '/' ~ file}) }}" alt="{{ file }}" class="image-blob" /></div>

        {% elseif file_type == 'markdown' %}
        <div class="md-view"><div id="md-content">{{ blob }}</div></div>

        {% else %}
        <pre id="sourcecode" language="{{ file_type }}">{{ blob }}</pre>
        {% endif %}
    </div>

{% endblock %}
